import request from '@/utils/request'
import store from '@/store'

export function addPrd (params) {
  return request({
    url: '/prd/save',
    method: 'post',
    data: Object.assign(params, { 'createUserId': store.getters.userInfo.id })
  })
}

export function queryPrd (params) {
  return request({
    url: '/prd/page',
    method: 'get',
    params: Object.assign(params, { 'createUserId': store.getters.userInfo.id })
  })
}

export function detailPrd (params) {
  return request({
    url: '/prd/detail/' + params.prdNo,
    method: 'get',
    params: params
  })
}

export function updatePrd (params) {
  return request({
    url: '/prd/upd',
    method: 'put',
    data: Object.assign(params, { 'updateUserId': store.getters.userInfo.id })
  })
}
